package com.prj.ufdm.cloud.ms.auth.enums;

/**
 * Desc: 授权模块返回码（编码规则：01 + 2位功能编号  + 3位错误编号）
 * @author 胡义振
 * @date 2020-03-02
 */
public enum AuthRetCodeEnum {
	
	RET_CODE_0101001("0101001","未登录"),
	RET_CODE_0101002("0101002","登录失败"),
	RET_CODE_0101003("0101003","注销成功"),
	RET_CODE_0101004("0101004","登录异常"),
	RET_CODE_0101005("0101005","Token不存在"),
	RET_CODE_0101006("0101006","Token验证异常"),
	RET_CODE_0101007("0101007","未授权"),
	RET_CODE_0101008("0101008","Token为空"),
	RET_CODE_0101009("0101009","Token超时"),
	RET_CODE_0101010("0101010","账号停用"),
	
	RET_CODE_0102001("0102001","用户名不能为空"),
	RET_CODE_0102002("0102002","用户密码不能为空"),
	RET_CODE_0102003("0102003","用户名已存在"),
	RET_CODE_0102004("0102004","用户ID不能为空"),
	RET_CODE_0102005("0102005","用户ID不存在"),
	RET_CODE_0102006("0102006","老密码不能为空"),
	RET_CODE_0102007("0102007","原密码不正确"),
	
	RET_CODE_0103001("0103001","角色ID不能为空"),
	RET_CODE_0103002("0103002","功能ID不能为空"),
	RET_CODE_0103003("0103003","机构编码不能为空"),
	RET_CODE_0103004("0103004","菜单名称不能为空"),
	RET_CODE_0103005("0103005","菜单url不能为空"),
	RET_CODE_0103006("0103006","角色名不能为空"),
	RET_CODE_0103007("0103007","角色名已存在"),
	RET_CODE_0103008("0103008","菜单名称已存在"),
	
	
	RET_CODE_0104001("0104001","参数类型编号不能为空"),
	RET_CODE_0104002("0104002","参数类型名称不能为空"),
	RET_CODE_0104003("0104003","参数编号不能为空"),
	RET_CODE_0104004("0104004","参数名称不能为空"),
	RET_CODE_0104005("0104005","参数值不能为空"),
	RET_CODE_0104006("0104006","参数类型不能为空"),
	RET_CODE_0104007("0104007","参数已存在"),
	RET_CODE_0104008("0104008","参数类型已存在"),
	RET_CODE_0104009("0104009","参数类型已被引用无法删除"),
	RET_CODE_0104010("0104010","参数批量变更校验未通过"),
	
	
	RET_CODE_0105001("0105001","职务不能为空"),
	RET_CODE_0105002("0105002","用户不能为空"),
	RET_CODE_0105003("0105003","用户授权机构不能为空"),
	RET_CODE_0105004("0105004","用户所属机构ID不能为空"),
	RET_CODE_0105005("0105005","用户所属机构名称不能为空"),
	
	RET_CODE_0106001("0106001","职务ID不能为空"),
	RET_CODE_0106002("0106002","机构ID不能为空"),
	RET_CODE_0106003("0106003","用户ID不能为空"),

	
	
	RET_CODE_0199999("RET_CODE_0199999","其他错误");
	
	private String code;
	private String message;
	
	
	AuthRetCodeEnum(String code,String message){
		this.code = code;
		this.message = message;
	}
	
	public static String getRetCodeName(String retErrCode){
		String rtnRetErrCode = "";
		for (AuthRetCodeEnum authRetCodeEnum : AuthRetCodeEnum.values()) {
			if(authRetCodeEnum.code.equals(retErrCode)){
				rtnRetErrCode = authRetCodeEnum.message;
			}
	    }
		return rtnRetErrCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}


}
